package com.scau.XFourPOS.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**     
 * 类名称：SaleOrderItem
 * 类描述：订单明细表
 * 创建人：庄祥鹏
 * */
@Entity
@Table(name = "sale_order_item")
public class SaleOrderItem {
	@Id
	@Column(unique=true,nullable=false)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	
	@ManyToOne(cascade={CascadeType.MERGE,CascadeType.REFRESH})
	private SaleOrder saleOrder; 	
	
	@ManyToOne(cascade={CascadeType.MERGE,CascadeType.REFRESH})
	private  Product product;
	
	@Column(length=11)
	private int quanity;
	
	@Column(length=11)
	private double price;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public SaleOrder getSaleOrder() {
		return saleOrder;
	}

	public void setSaleOrder(SaleOrder saleOrder) {
		this.saleOrder = saleOrder;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public int getQuanity() {
		return quanity;
	}

	public void setQuanity(int quanity) {
		this.quanity = quanity;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}
	
	
	
}
